﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //TextBox usename = (TextBox)PreviousPage.FindControl("UserName");

            //TextBox password = (TextBox)PreviousPage.FindControl("Password");
            string userName = null;
            string password = null;

            string method = Request.HttpMethod;
            if (method == "GET")
            {
                userName = Request.QueryString["username"];
                password = Request.QueryString["password"];
                Response.Write("Response.QueryString ===> " + userName + "<br/>");
                Response.Write("Response.QueryString ===> " + password + "<br/><br/>");
            }
            else if (method == "POST")
            {
                userName = Request.Form["UserName"];
                password = Request.Form["Password"];
                Response.Write("Response.Form ===> " + userName + "<br/>");
                Response.Write("Response.Form ===> " + password + "<br/><br/>");
            }

            Response.Write($"<h3>欢迎你，{userName},密码 {password}</h3>");


            

            
        }
    }
}